package com.ayz.gateway.api.server;


import com.ayz.gateway.api.request.RegistryApplication;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.52.1)",
    comments = "Source: gateway_grpc_registeApplication.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class RegistryApplicationServerGrpc {

  private RegistryApplicationServerGrpc() {}

  public static final String SERVICE_NAME = "RegistryApplicationServer";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<RegistryApplication.RegistryApplicationRequest,
      com.google.protobuf.Empty> getRegisterApplicationMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "registerApplication",
      requestType = RegistryApplication.RegistryApplicationRequest.class,
      responseType = com.google.protobuf.Empty.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<RegistryApplication.RegistryApplicationRequest,
      com.google.protobuf.Empty> getRegisterApplicationMethod() {
    io.grpc.MethodDescriptor<RegistryApplication.RegistryApplicationRequest, com.google.protobuf.Empty> getRegisterApplicationMethod;
    if ((getRegisterApplicationMethod = RegistryApplicationServerGrpc.getRegisterApplicationMethod) == null) {
      synchronized (RegistryApplicationServerGrpc.class) {
        if ((getRegisterApplicationMethod = RegistryApplicationServerGrpc.getRegisterApplicationMethod) == null) {
          RegistryApplicationServerGrpc.getRegisterApplicationMethod = getRegisterApplicationMethod =
              io.grpc.MethodDescriptor.<RegistryApplication.RegistryApplicationRequest, com.google.protobuf.Empty>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "registerApplication"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  RegistryApplication.RegistryApplicationRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setSchemaDescriptor(new RegistryApplicationServerMethodDescriptorSupplier("registerApplication"))
              .build();
        }
      }
    }
    return getRegisterApplicationMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static RegistryApplicationServerStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerStub>() {
        @Override
        public RegistryApplicationServerStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RegistryApplicationServerStub(channel, callOptions);
        }
      };
    return RegistryApplicationServerStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static RegistryApplicationServerBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerBlockingStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerBlockingStub>() {
        @Override
        public RegistryApplicationServerBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RegistryApplicationServerBlockingStub(channel, callOptions);
        }
      };
    return RegistryApplicationServerBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static RegistryApplicationServerFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerFutureStub> factory =
      new io.grpc.stub.AbstractStub.StubFactory<RegistryApplicationServerFutureStub>() {
        @Override
        public RegistryApplicationServerFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new RegistryApplicationServerFutureStub(channel, callOptions);
        }
      };
    return RegistryApplicationServerFutureStub.newStub(factory, channel);
  }

  /**
   */
  public static abstract class RegistryApplicationServerImplBase implements io.grpc.BindableService {

    /**
     */
    public void registerApplication(RegistryApplication.RegistryApplicationRequest request,
                                    io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRegisterApplicationMethod(), responseObserver);
    }

    @Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getRegisterApplicationMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                RegistryApplication.RegistryApplicationRequest,
                com.google.protobuf.Empty>(
                  this, METHODID_REGISTER_APPLICATION)))
          .build();
    }
  }

  /**
   */
  public static final class RegistryApplicationServerStub extends io.grpc.stub.AbstractAsyncStub<RegistryApplicationServerStub> {
    private RegistryApplicationServerStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected RegistryApplicationServerStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RegistryApplicationServerStub(channel, callOptions);
    }

    /**
     */
    public void registerApplication(RegistryApplication.RegistryApplicationRequest request,
                                    io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegisterApplicationMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class RegistryApplicationServerBlockingStub extends io.grpc.stub.AbstractBlockingStub<RegistryApplicationServerBlockingStub> {
    private RegistryApplicationServerBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected RegistryApplicationServerBlockingStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RegistryApplicationServerBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.google.protobuf.Empty registerApplication(RegistryApplication.RegistryApplicationRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getRegisterApplicationMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class RegistryApplicationServerFutureStub extends io.grpc.stub.AbstractFutureStub<RegistryApplicationServerFutureStub> {
    private RegistryApplicationServerFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @Override
    protected RegistryApplicationServerFutureStub build(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      return new RegistryApplicationServerFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> registerApplication(
        RegistryApplication.RegistryApplicationRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getRegisterApplicationMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_REGISTER_APPLICATION = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final RegistryApplicationServerImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(RegistryApplicationServerImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @Override
    @SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_REGISTER_APPLICATION:
          serviceImpl.registerApplication((RegistryApplication.RegistryApplicationRequest) request,
              (io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @Override
    @SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class RegistryApplicationServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    RegistryApplicationServerBaseDescriptorSupplier() {}

    @Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return RegistryApplication.getDescriptor();
    }

    @Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("RegistryApplicationServer");
    }
  }

  private static final class RegistryApplicationServerFileDescriptorSupplier
      extends RegistryApplicationServerBaseDescriptorSupplier {
    RegistryApplicationServerFileDescriptorSupplier() {}
  }

  private static final class RegistryApplicationServerMethodDescriptorSupplier
      extends RegistryApplicationServerBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    RegistryApplicationServerMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (RegistryApplicationServerGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new RegistryApplicationServerFileDescriptorSupplier())
              .addMethod(getRegisterApplicationMethod())
              .build();
        }
      }
    }
    return result;
  }
}
